<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>确认订单</title>
    <!-- layUI的核心CSS文件 -->
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/layui-v2.5.7/layui/css/layui.css"/>
    <!-- layUI的核心JS文件 -->
    <script src="${pageContext.request.contextPath}/static/layui-v2.5.7/layui/layui.js" type="text/javascript"
            charset="UTF-8"></script>
</head>
<body>


<%--<form class="layui-form">--%>
<div class="layui-layout layui-layout-admin">

    <div class="layui-header">

        <div class="layui-logo"><a style="color: #009688;">龙洞闲置购物系统</a></div>

        <!-- 头部区域（可配合layui已有的水平导航） -->

        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item">
                <a href="ShowALLGoods">首页</a>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">确认订单</a>

            </li>
            <script type="text/javascript">
                layui.use('form', function () {
                    var form = layui.form;
                    form.on('submit(search)', function (data) {
                        console.log(data);
                        return false;
                    });
                });
            </script>
        </ul>
        <%--</form>--%>
        <%@include file="../common/head.jsp"%>
    </div>

    <div class="layui-col-md-offset2 layui-col-md8" style="margin-top: 150px;">
        <form id="form1" class="layui-form layui-form-pane" action="createOrder2" method="post">
            <div class="layui-row">
                <div class="layui-col-md5"
                     style="border: 1px solid black;margin: 20px;height: 400px;text-align: center;">
                    <c:if test="${goods.gimg_path==''}">
                        <img src="${pageContext.request.contextPath}/static/images/white1.jpg"
                             style="max-width: 100%;max-height: 100%;">
                    </c:if>
                    <c:if test="${goods.gimg_path!=''}">
                        <img src="${goods.gimg_path}"
                             style="max-width: 100%;max-height: 100%;">
                    </c:if>
                </div>

                <%--						发送隐藏表单--%>
                <input type="hidden" name="obid" value="${user.uid}">
                <input type="hidden" name="osid" value="${goods.guid}">
                <input type="hidden" name="ogid" value="${goods.gid}">
                <input type="hidden" name="otime" value="">
                <input type="hidden" name="ostatus" value="已完成">
                <input type="hidden" name="onumber" value="1">
                <input type="hidden" name="oprice" value="${goods.gprice}">
                <input type="hidden" name="ogname" value="${goods.gname}">
                <input type="hidden" name="ogdetail" value="${goods.gdetail}">
                <input type="hidden" name="obname" value="${user.uname}">
                <input type="hidden" name="osname" value="${goods.guname}">
                <c:if test="${goods.gimg_path!=null}">
                    <input type="hidden" name="ogimgpath" value="${goods.gimg_path}">
                </c:if>

                <div class="layui-col-md6" style="margin:20px;margin-top: 30px;">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            商品名：
                        </label>
                        <div class="layui-input-inline" style="width: 414px;">
                            <input type="text" value="${goods.gname}" name="title" required lay-verify="required" autocomplete="off"
                                   class="layui-input"  style="color: black" disabled>

                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">地址：</label>
                        <div class="layui-input-inline">
                            <select name="oposition" lay-verify="required">
                                <option value="">请选择交易地点</option>
                                <option value="外区宿舍">外区宿舍</option>
                                <option value="A区宿舍">A区宿舍</option>
                                <option value="C区宿舍">C区宿舍</option>
                                <option value="G区宿舍">G区宿舍</option>
                                <option value="水饭">水饭</option>
                                <option value="内饭">内饭</option>
                            </select>
                        </div>

                        <div class="layui-input-inline" style="width: 215px">
                            <input type="text" name="oposition" required lay-verify="required" placeholder="详细地址" autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">价格：</label>
                        <div class="layui-input-inline" style="width: 414px;">
                            <input type="text"  style="color: black" value="${goods.gprice}元" name="title" required lay-verify="required" autocomplete="off"
                                   class="layui-input" disabled>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">备注信息</label>
                        <div class="layui-input-inline" style="width: 414px;">
                            <input type="text" name="onote" autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item" style="margin-top: 120px; ">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit>确认购买</button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <script>
            let form1 = document.getElementById("form1");
            form1.onsubmit = function () {
                layui.use('layer', function () {
                    var layer = layui.layer;
                    layer.msg('购买成功');
                });
            }
        </script>

    </div>
</div>
</body>
</html>